from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import random


op = webdriver.ChromeOptions()
op.add_experimental_option('excludeSwitches', ['enable-automation'])
op.add_experimental_option('useAutomationExtension', False)
driver = webdriver.Chrome(options=op)
driver.get(r"https://jqueryui.com/slider/#hotelrooms")


iframe1 = driver.find_element(By.CSS_SELECTOR,'#content > iframe')
driver.switch_to.frame(iframe1)
wait = WebDriverWait(driver, 5 ,0.5)
ele = wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, '#minbeds')))
ele1 = [1,2,3,4,5,6]
qk = random.choice(ele1)
Select(ele).select_by_visible_text(str(qk))
sleep(2)
driver.quit()